<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('考勤管理列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
            	<input type="hidden" name="day" id="day" th:value="${day}"/>
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>主合同编号：</label>
                                <input type="text" name="orderNo"/>
                            </li>
                            <li>
                                <label>主合同名称：</label>
                                <input type="text" name="name"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var datas = [[${@dict.getType('gys_kqstatus')}]];
        var prefix = ctx + "gcgl/kqproject";

        $(function() {
            var options = {
                url: prefix + "/list",
                detailUrl: prefix + "/kqtjdetail/{id}/"+$("#day").val(),
                modalName: "考勤管理",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'id',
                    title: '主键',
                    visible: false
                },
                {
                    field: 'gysptProjectid',
                    title: '合同ID',
                    visible: false
                },
                {
                    field: 'orderNo',
                    title: '主合同编号'
                },
                {
                    field: 'customerName',
                    title: '公司名称'
                },
                {
                    field: 'name',
                    title: '主合同名称'
                },
                {
                    field: 'jshj',
                    title: '价税合计'
                },
                {
                    field: 'jig',
                    title: '机构'
                },
                {
                    field: 'piny',
                    title: '拼音码',
                    visible: false
                },
                {
                    field: 'jfriq',
                    title: '履约交付时间'
                },
                {
                    field: 'adress',
                    title: '项目地址',
                    visible: false
                },
                {
                    field: 'htype',
                    title: '合同类型',
                    visible: false
                },
                {
                    field: 'lxr',
                    title: '联系人'
                },
                {
                    field: 'qdriq',
                    title: '履约开始时间',
                    visible: false
                },
                {
                    field: 'projectManager',
                    title: '项目经理'
                },
                {
                    field: 'owner',
                    title: '成本合约'
                },
                {
                    field: 'descs',
                    title: '备注',
                    visible: false
                },
                {
                    field: 'status',
                    title: '状态',
                    formatter: function(value, row, index) {
                    	return $.table.selectDictLabel(datas, value);
                    }
                },
                {
                    field: 'createUser',
                    title: '创建人',
                    visible: false
                },
                {
                    field: 'createAt',
                    title: '创建时间',
                    visible: false
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="$.operate.detailTab(\'' + row.id + '\')"><i class="fa fa-edit"></i>打印考勤统计</a> ');
                        actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="gztDetail(\'' + row.id + '\')"><i class="fa fa-edit"></i>打印工资条</a> ');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
        
        //工资条详情
        function gztDetail(id){
            $.modal.openTab('工资条详情',"/gcgl/kqproject/kqgztview/"+id+"/"+$("#day").val());
        }
    </script>
</body>
</html>